package com.sendi.system.action;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

 

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.beans.BeanUtils;

import com.sendi.system.entity.Functionmoudle;
import com.sendi.system.entity.SystemPower;
import com.sendi.system.util.menu.Menu;
import com.sendi.system.util.menu.MenuItem;
import com.sendi.system.util.menu.ToolBarItem;
import com.sendi.system.util.sort.MoudleSorter;
import com.sendi.system.util.tree.MoudleTreeNode;
import com.sendi.system.util.tree.TreeNode;
import com.sendi.system.util.tree.moudelTreeData;
/*
 * 对于每个个模块的更新与增，删除都同步了内存中的模块树，删除时还做了系统权限的更新
 */
public class functionmoudleAction extends SysAction {
    private Integer  id;
    
	private String moudletitle;
	private String moudleid;
	private String moudletype;
	private String isleaf="off";
	private String openurl="";
	private String icon="";
	private Integer parentid;
	private Integer orderid;
	
   private String deleterecord;
   private int  clickleafid;
   public String reloadflag="no";
   public String userpowerfilter;
   public String isusedesktop="no";//是否使用桌面风格
   public String iconcls;
   public String addshutcut="off";
   public String shutcuturl;
  
	public functionmoudleAction()
	{
		super();
		data_session_name="FunctionActionListData";
		 
	}
	
	/*
	 * 列出所有模块树结构
	 */
	public void listmoudletree()
	{
	   
 		String hql="from Functionmoudle where  parentid="+this.Treeid+" and moudletype in('f','s','t') order by orderid asc";
		List datas=null;
	 	datas=serviceSupportImp.findByHQL(hql);
	    ArrayList<moudelTreeData> children=new ArrayList<moudelTreeData>();
	    HashMap<String,String> powerMap=( HashMap<String,String>)this.getSession().getAttribute("userSystemPower");
	    
		for(Object o:datas)
		{
			moudelTreeData ct=new moudelTreeData();
			Functionmoudle f=(Functionmoudle)o;
		 	ct.setId(f.getId());
			ct.setLeaf(f.getIsleaf().equals("on")?true:false);
			ct.setText(f.getMoudletitle());
			ct.setIcon(f.getIcon());
			ct.setMoudleid(f.getMoudleid());
			ct.setMoudletype(f.getMoudletype());
			ct.setOpenurl(f.getOpenurl());
			ct.setIconcls(f.getIconcls());
			if(this.userpowerfilter!=null&&this.userpowerfilter.equals("userpowerfilter"))
			{
				
				if(this.getSession().getAttribute("userid").toString().equals("admin"))
				{
					children.add(ct);//系统管理员有最高权限 
				}
				else if(powerMap!=null&&powerMap.get(ct.getId()+"")!=null)
				{
					children.add(ct);
				}
				
			}
			else
			{
				children.add(ct);
			}
		 
			 
	 	}
		   String jsons = JSONArray.fromObject(children).toString();
	        System.out.println(jsons);
	       writeResponseText(jsons);
	   
	}
	
	// ////迭代出所有子菜单项目
	  public void IteratorMenueItem(MenuItem ctb, HashMap<String,String> powerMap,MoudleSorter ms,HashMap<String,MoudleTreeNode> moudletreemap)
	   {
 
			List datas=null;
		  	datas=moudletreemap.get(ctb.id+"").getMchild();
		  	if(datas!=null&&datas.size()>0)
		    {
		    	 Collections.sort(datas, ms);
		    	 ctb.menu=new Menu();
		    }
		    else
		    {
		    	return;
		    }
		   
			for(Object o:datas)
			{
				
				MenuItem ct=new MenuItem();
				try
				{
		 			Functionmoudle f=(Functionmoudle)o;
				 	ct.id=f.getId();
					ct.setLeaf(f.getIsleaf().equals("on")?true:false);
					ct.setText(f.getMoudletitle());
					ct.setIcon(f.getIcon());
					ct.setMoudleid(f.getMoudleid());
					ct.setOpenurl(f.getOpenurl());
					ct.setIconcls(f.getIconcls());
					 
					if(this.isusedesktop.equals("yes"))
					{
				 		ct.setHandler("function(src){createWin(src)}");
					}
				 
				}
				catch (Exception e) {
				 
				}
				if(this.userpowerfilter!=null&&this.userpowerfilter.equals("userpowerfilter"))
				{
						if(this.getSession().getAttribute("userid").toString().equals("admin"))
						{
							ctb.menu.items.add(ct);//系统管理员有最高权限 
						}
						else if(powerMap!=null&&powerMap.get(ct.id+"")!=null)
						{
							ctb.menu.items.add(ct);
						}
				
		 		}
				else
				{
					ctb.menu.items.add(ct);
				}
		 	 	
			
				
		 	}
			
			for(MenuItem tbi:ctb.menu.items)
			{
			 	IteratorMenueItem(tbi,powerMap,ms,moudletreemap);
			}
			
			
	   }
	//迭代出所有菜单 
   public void IteratorChildMenue(ToolBarItem ctb, HashMap<String,String> powerMap,MoudleSorter ms,HashMap<String,MoudleTreeNode> moudletreemap)
   {
	    
	  	List datas=null;
	  	datas=moudletreemap.get(ctb.id+"").getMchild();
	     if(datas!=null&&datas.size()>0)
	    {
	    	 Collections.sort(datas, ms);
	    	 ctb.menu=new Menu();
	    }
	    else
	    {
	    	return;
	    }
	   
		for(Object o:datas)
		{
			
			MenuItem ct=new MenuItem();
			try
			{
	 			Functionmoudle f=(Functionmoudle)o;
	 			ct.id=f.getId();
				ct.setLeaf(f.getIsleaf().equals("on")?true:false);
				ct.setText(f.getMoudletitle());
				ct.setIcon(f.getIcon());
				ct.setMoudleid(f.getMoudleid());
				ct.setOpenurl(f.getOpenurl());
				ct.setIconcls(f.getIconcls());
			 	if(this.isusedesktop.equals("yes"))
				{
					ct.setHandler("function(src){createWin(src)}");
				}
			}
			catch (Exception e) {
			 
			}
			if(this.userpowerfilter!=null&&this.userpowerfilter.equals("userpowerfilter"))
			{
					if(this.getSession().getAttribute("userid").toString().equals("admin"))
					{
						ctb.menu.items.add(ct);//系统管理员有最高权限 
					}
					else if(powerMap!=null&&powerMap.get(ct.id+"")!=null)
					{
						ctb.menu.items.add(ct);
					}
			
	 		}
			else
			{
				ctb.menu.items.add(ct);
			}
	 	 	
		
			
	 	}
	
		for(MenuItem tbi:ctb.menu.items)
		{
		 	IteratorMenueItem(tbi,powerMap,ms,moudletreemap); ////迭代出所有子菜单项目
		}
		
		
   }
 
 
	public void listallMoudletoMenu()
	{
	 	List datas=null;
	  	Object mt=this.getServletContext().getAttribute("sendi_sys_module_tree");
	 	HashMap<String,MoudleTreeNode> moudletreemap=null;
	 	if(mt!=null)
	 	{
	 		moudletreemap=(HashMap<String,MoudleTreeNode>)mt;
	 		datas=moudletreemap.get("-1").getMchild();
	 	}
	 
	 	MoudleSorter ms=new MoudleSorter();
	 	if(datas.size()>0)
	 	{
	 		Collections.sort(datas, ms);
	 	}
	 	
	    ArrayList<ToolBarItem> children=new ArrayList<ToolBarItem>();
	    HashMap<String,String> powerMap=( HashMap<String,String>)this.getSession().getAttribute("userSystemPower");
		for(Object o:datas)
		{
			
			ToolBarItem ct=new ToolBarItem();
			try
			{
	 			Functionmoudle f=(Functionmoudle)o;
	 			ct.id=f.getId();
			  	ct.setText(f.getMoudletitle());
				ct.setIcon(f.getIcon());
				ct.setIconcls(f.getIconcls());
			 
			}
			catch (Exception e) {
				e.printStackTrace();			 
			}
			if(this.userpowerfilter!=null&&this.userpowerfilter.equals("userpowerfilter"))
			{
					if(this.getSession().getAttribute("userid").toString().equals("admin"))
					{
						children.add(ct);//系统管理员有最高权限 
					}
					else if(powerMap!=null&&powerMap.get(ct.id+"")!=null)
					{
						children.add(ct);
					}
			
				
			}
			else
			{
				children.add(ct);
			}
	 	 	
			 
	 	}
	
		for(ToolBarItem tbi:children)
		{
		 	IteratorChildMenue(tbi,powerMap,ms,moudletreemap); //迭代出所有菜单
		}
	 
		String json=JSONArray.fromObject(children).toString();
		writeResponseText(json);
 	}
	/*
	 * 获取一级模块
	 */
	public void listFirstMoudle()
	{
		 
 	 	List datas=null;
	  	Object mt=this.getServletContext().getAttribute("sendi_sys_module_tree");
	 	HashMap<String,MoudleTreeNode> moudletreemap=null;
	 	if(mt!=null)
	 	{
	 		moudletreemap=(HashMap<String,MoudleTreeNode>)mt;
	 		datas=moudletreemap.get("-1").getMchild();
	 	}
	 	MoudleSorter ms=new MoudleSorter();
	 	if(datas.size()>0)
	 	{
	 		Collections.sort(datas, ms);
	 	}
		
 	 	
	    ArrayList<moudelTreeData> children=new ArrayList<moudelTreeData>();
	    HashMap<String,String> powerMap=( HashMap<String,String>)this.getSession().getAttribute("userSystemPower");
		for(Object o:datas)
		{
			
			moudelTreeData ct=new moudelTreeData();
			try
			{
	 			Functionmoudle f=(Functionmoudle)o;
			 	ct.setId(f.getId());
				ct.setLeaf(f.getIsleaf().equals("on")?true:false);
				ct.setText(f.getMoudletitle());
				ct.setIcon(f.getIcon());
				ct.setMoudleid(f.getMoudleid());
				ct.setOrderid(f.getOrderid()); 
				ct.setIconcls(f.getIconcls());
			}
			catch (Exception e) {
			 
			}
			if(this.userpowerfilter!=null&&this.userpowerfilter.equals("userpowerfilter"))
			{
					if(this.getSession().getAttribute("userid").toString().equals("admin"))
					{
						children.add(ct);//系统管理员有最高权限 
					}
					else if(powerMap!=null&&powerMap.get(ct.getId()+"")!=null)
					{
						children.add(ct);
					}
			
				
			}
			else
			{
				children.add(ct);
			}
	 	 	
			 
	 	}
		writeJSONArray(children);
	 
		
	}
	/*
	 * 列出模块树结构，采用 servlet context中的
	 */
	public void listmoudletreenode()
	{
	   
		List datas=null;
	  	Object mt=this.getServletContext().getAttribute("sendi_sys_module_tree");
	 	HashMap<String,MoudleTreeNode> moudletreemap=null;
	 	if(mt!=null)
	 	{
	 		moudletreemap=(HashMap<String,MoudleTreeNode>)mt;
	 		datas=moudletreemap.get(this.Treeid+"").getMchild();
	 	}
	 	MoudleSorter ms=new MoudleSorter();
		if(datas.size()>0)
	 	{
	 		Collections.sort(datas, ms);
	 	}
		
		
	    ArrayList<moudelTreeData> children=new ArrayList<moudelTreeData>();
	    HashMap<String,String> powerMap=( HashMap<String,String>)this.getSession().getAttribute("userSystemPower");
	    
		for(Object o:datas)
		{
			moudelTreeData ct=new moudelTreeData();
			Functionmoudle f=(Functionmoudle)o;
		 	ct.setId(f.getId());
			ct.setLeaf(f.getIsleaf().equals("on")?true:false);
			ct.setText(f.getMoudletitle());
			ct.setIcon(f.getIcon());
			ct.setMoudleid(f.getMoudleid());
			ct.setMoudletype(f.getMoudletype());
			ct.setOpenurl(f.getOpenurl());
			ct.setIconcls(f.getIconcls());
			if(this.userpowerfilter!=null&&this.userpowerfilter.equals("userpowerfilter"))
			{
				
				if(this.getSession().getAttribute("userid").toString().equals("admin"))
				{
					children.add(ct);//系统管理员有最高权限 
				}
				else if(powerMap!=null&&powerMap.get(ct.getId()+"")!=null)
				{
					children.add(ct);
				}
				
			}
			else
			{
				children.add(ct);
			}
		 
			 
	 	}
		   String jsons = JSONArray.fromObject(children).toString();
	        System.out.println(jsons);
	       writeResponseText(jsons);
	   
	}
	
	   public void listallMoudletoMenuBar()
	    {
	        List datas = null;
	        Object mt = getServletContext().getAttribute("sendi_sys_module_tree");
	    	HashMap<String,MoudleTreeNode> moudletreemap=null;
	        if(mt != null)
	        {
	        	moudletreemap=(HashMap<String,MoudleTreeNode>)mt;
	        	datas=moudletreemap.get("-1").getMchild();
	        }
	    	
	        MoudleSorter ms = new MoudleSorter();
	        if(datas.size() > 0)
	            Collections.sort(datas, ms);
	        ArrayList<ToolBarItem> children = new ArrayList<ToolBarItem>();
	        HashMap<String,String> powerMap=( HashMap<String,String>)this.getSession().getAttribute("userSystemPower");
	        for(Object o:datas)
	        {
	             ToolBarItem ct = new ToolBarItem();
	            try
	            {
	                Functionmoudle f = (Functionmoudle)o;
	                ct.id = f.getId().intValue();
	                ct.setText(f.getMoudletitle());
	                ct.setIcon(f.getIcon());
	                ct.setIconcls(f.getIconcls());
	                ct.menuid = f.getId().intValue();
	            }
	            catch(Exception e)
	            {
	                e.printStackTrace();
	            }
	            if(userpowerfilter != null && userpowerfilter.equals("userpowerfilter"))
	            {
	                if(getSession().getAttribute("userid").toString().equals("admin"))
	                    children.add(ct);
	                else
	                if(powerMap != null && powerMap.get((new StringBuilder(String.valueOf(ct.id))).toString()) != null)
	                    children.add(ct);
	            } else
	            {
	                children.add(ct);
	            }
	        }

	        String json = JSONArray.fromObject(children).toString();
	        System.out.println( json);
	        writeResponseText(json);
	    }
	  
	  
	public void moudleInit()
	{
		 
		 List datas=null;
	 
		if(this.reloadflag.equalsIgnoreCase("no")&&getSession().getAttribute(data_session_name)!=null)
		{
			datas=(List)getSession().getAttribute(data_session_name);
			System.out.println("use session size"+datas.size());
		}
		else
		{
			addMoudleTosessin();
			datas=(List)getSession().getAttribute(data_session_name);
		}
	 
			writeJSONArray(datas);
		 
	}
	
	public void addMoudleTosessin()
	{
		List datas=null;
		String hql="from  Functionmoudle where parentid="+this.clickleafid;
	  	datas=serviceSupportImp.findByHQL(hql);
		getSession().setAttribute(data_session_name,datas);
 	}
	
 
   /*
    * 查询用户
    */
	public void queryMoudlefunction()
	{
		   try
		   {
			     Session session=serviceSupportImp.getDao().getSessionFactory().openSession();
			 	StringBuffer hql=new StringBuffer("from Functionmoudle where 1=1 ");
				if(moudletitle!=null&&moudletitle.trim().length()>0)
				{
					hql.append(" and  moudletitle like :moudletitle ");
				}
				if(moudleid!=null&&moudleid.trim().length()>0)
				{
					hql.append(" and moudleid like :moudleid");
				}
				
				   Query query= session.createQuery(hql.toString());
				   if(moudletitle!=null&&moudletitle.trim().length()>0)
					{
					  query.setParameter("moudletitle", "%"+moudletitle+"%");
					}
					if(moudleid!=null&&moudleid.trim().length()>0)
					{
				 		  query.setParameter("moudleid", "%"+moudleid+"%");
					}
					   List datas=query.list();
					    System.out.println("query size"+datas.size());
				     	getSession().setAttribute(data_session_name,datas);	
				     	writeResponseText("{success:true,msg:'success',datasize:"+datas.size()+"}");
		   			}
		   catch (Exception e) {
			   writeResponseText("{success:false,msg:'failure'}");
				 
		}
		    
		
	}

 
	 public void addMoudlefunction()
	 {
	 	 Functionmoudle Functionmoudle=new Functionmoudle();
		 Functionmoudle.setIcon(icon);
		 Functionmoudle.setIsleaf(isleaf);
		 Functionmoudle.setMoudleid(moudleid);
		 Functionmoudle.setMoudletitle(moudletitle);
		 Functionmoudle.setOpenurl(openurl);
		 Functionmoudle.setParentid(parentid);
		 Functionmoudle.setOrderid(orderid);
		 Functionmoudle.setIconcls(iconcls);
		 Functionmoudle.setAddshutcut(addshutcut);
		 Functionmoudle.setShutcuturl(shutcuturl);
		 String moudletype="f";
		
		 if(isleaf.equals("off"))
		 {
			 moudletype="s";
		 }
		 else
		 {
			 moudletype="t";
		 }
		 if(parentid==-1) //根结点下不允许添加二级模块，与三级模块
		 {
			 moudletype="f";
			 Functionmoudle.setIsleaf("off");
			 Functionmoudle.setOpenurl("");
		 }
		 Functionmoudle.setMoudletype(moudletype);
			
			try {
				serviceSupportImp.save(Functionmoudle);
				getSession().removeAttribute(data_session_name);
				addMoudleTosessin();
				writeResponseText("{success:true,msg:'success'}");
			 	Object mt=this.getServletContext().getAttribute("sendi_sys_module_tree");
			 	HashMap<String,MoudleTreeNode> moudletreemap=null;
			 	if(mt!=null)
			 	{
			 		moudletreemap=(HashMap<String,MoudleTreeNode>)mt;
			 		MoudleTreeNode pmt=moudletreemap.get(parentid+"");
			 		
			 		MoudleTreeNode tn=new MoudleTreeNode();
			 		tn.setTreeId(Functionmoudle.getId());
			 		tn.setText(Functionmoudle.getMoudletitle());
			 		tn.setIsleaf(Functionmoudle.getIsleaf().equalsIgnoreCase("off")?false:true);
			 		tn.setParentId(Functionmoudle.getParentid());
			 		tn.setParentNode(pmt);
			 		tn.fn=Functionmoudle;
			 	    pmt.AddChildNode(tn);
			 	    pmt.AddMChildNode(tn);
			 	    moudletreemap.put(tn.getTreeId()+"", tn);
			   }
		 	 
		 	} catch (Exception e) {
				writeResponseText("{success:false,msg:'faild',errors:{"+e.getMessage()+"}}");
			  e.printStackTrace();
			}
	 }

	 
	 public void excutModifyQuerymoudle()
		{
			 
			String hql="from Functionmoudle where 1=1 and id="+this.id; 
		 	List datas=serviceSupportImp.findByHQL(hql);
		  	Functionmoudle User=(Functionmoudle)datas.get(0);
			try {
			 	writeResponseText("{success:true,datas:"+JSONObject.fromObject(User).toString()+"}");
			} catch (Exception e) {
		 	   writeResponseText("{success:false,msg:'faild',errors:{"+e.getMessage()+"}}");
			 	e.printStackTrace();
			}
			
		}
		public void excuteModifymoudle()
		{
		 
			String hql="from Functionmoudle where 1=1 and id="+this.id; 
			
			List datas=serviceSupportImp.findByHQL(hql);
	 	 	Functionmoudle Functionmoudle=(Functionmoudle)datas.get(0);
	 	 	 Functionmoudle.setIcon(icon);
			 Functionmoudle.setIsleaf(isleaf);
			 Functionmoudle.setMoudleid(moudleid);
			 Functionmoudle.setMoudletitle(moudletitle);
			 Functionmoudle.setOpenurl(openurl);
			 Functionmoudle.setParentid(parentid);
			 Functionmoudle.setOrderid(orderid);
			 Functionmoudle.setIconcls(iconcls);
			 Functionmoudle.setShutcuturl(shutcuturl);
			 Functionmoudle.setAddshutcut(addshutcut);
			 String moudletype="f";
			
			 if(isleaf.equals("off"))
			 {
				 moudletype="s";
			 }
			 else
			 {
				 moudletype="t";
			 }
			 if(parentid==-1) //根结点下不允许添加二级模块，与三级模块
			 {
				 moudletype="f";
				 Functionmoudle.setIsleaf("off");
				 Functionmoudle.setOpenurl("");
			 }
		 	serviceSupportImp.update(Functionmoudle);
		 	getSession().removeAttribute(data_session_name);
			addMoudleTosessin();
			 writeResponseText("{success:true,msg:'success'}"); 
			///更新内存中的模型树
		  	Object mt=this.getServletContext().getAttribute("sendi_sys_module_tree");
		 	HashMap<String,MoudleTreeNode> moudletreemap=null;
		 	if(mt!=null)
		 	{
		 		moudletreemap=(HashMap<String,MoudleTreeNode>)mt;
		 		MoudleTreeNode moudleTreeNode=moudletreemap.get(Functionmoudle.getId()+"");
		 		BeanUtils.copyProperties(Functionmoudle, moudleTreeNode.fn);
		 	 	moudleTreeNode.setIsleaf(Functionmoudle.getIsleaf().equalsIgnoreCase("off")?false:true);
		 		moudleTreeNode.setText(Functionmoudle.getMoudletitle());
		 		moudleTreeNode.setParentId(Functionmoudle.getParentid());
		   }
	      
		}
		
		public void excuteDeletemoudle()
		{
			//todo 这里还差一个递归算法进行删除，目前只删除到下一级的节点，再下一级的节点不能删除了
		  String hql="delete from  functionmoudle where id in ("+deleterecord+") or  parentid in ("+deleterecord+")";
		  String hql2="delete from  system_power where   moudleid in ("+deleterecord+")";
		    String sql[]=new String[2];
		     sql[0]=hql;
		     sql[1]=hql2;
		   this.excuteBatchDelete(sql);
		  addMoudleTosessin();
		  writeResponseText("{success:true,msg:'success'}"); 
		  
		  //更新内存中的树结构
		 	Object mt=this.getServletContext().getAttribute("sendi_sys_module_tree");
		 	HashMap<String,MoudleTreeNode> moudletreemap=null;
		 	if(mt!=null)
		 	{
		 		moudletreemap=(HashMap<String,MoudleTreeNode>)mt;
		    }
		 	try
		 	{
		 	   String c[]=this.deleterecord.replaceAll("'", "").split(",");
		 	   for(String b:c)
		 	   {
		 			MoudleTreeNode moudleTreeNode=moudletreemap.get(b);
		 			MoudleTreeNode pnode=(MoudleTreeNode)moudleTreeNode.parentNode;
		 			pnode.removeChild(moudleTreeNode);
		 			pnode.removeMChildNode(moudleTreeNode.fn);		 
		 	  }

		 	    String hql7="from SystemPower";
		 	    HashMap<String,SystemPower> systemPower=(HashMap<String,SystemPower>)applicationContextHelper.servletContext.getAttribute("sendi_sys_moudlePower_info");
		 	    systemPower.clear();
		 	    List datas7=this.getListData(hql7);
				 for(Object o7:datas7)
				 {
					 SystemPower slb=(SystemPower)o7;
					 systemPower.put(slb.getId()+"",slb);
				 }
	 	  	}
		 	catch (Exception e) {
				 e.printStackTrace();
			}
	 
		}
	public Integer getId() {
		return id;
	}



	public void setId(Integer id) {
		this.id = id;
	}
 
	public String getDeleterecord() {
		return deleterecord;
	}


	public void setDeleterecord(String deleterecord) {
		this.deleterecord = deleterecord;
	}

	public int getClickleafid() {
		return clickleafid;
	}

	public void setClickleafid(int clickleafid) {
		this.clickleafid = clickleafid;
	}

	public String getMoudletitle() {
		return moudletitle;
	}

	public void setMoudletitle(String moudletitle) {
		this.moudletitle = moudletitle;
	}

	public String getMoudleid() {
		return moudleid;
	}

	public void setMoudleid(String moudleid) {
		this.moudleid = moudleid;
	}

	public String getMoudletype() {
		return moudletype;
	}

	public void setMoudletype(String moudletype) {
		this.moudletype = moudletype;
	}

	public String getIsleaf() {
		return isleaf;
	}

	public void setIsleaf(String isleaf) {
		this.isleaf = isleaf;
	}

	public String getOpenurl() {
		return openurl;
	}

	public void setOpenurl(String openurl) {
		this.openurl = openurl;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public Integer getParentid() {
		return parentid;
	}

	public void setParentid(Integer parentid) {
		this.parentid = parentid;
	}

	public Integer getOrderid() {
		return orderid;
	}

	public void setOrderid(Integer orderid) {
		this.orderid = orderid;
	}

	public String getReloadflag() {
		return reloadflag;
	}

	public void setReloadflag(String reloadflag) {
		this.reloadflag = reloadflag;
	}

	public String getUserpowerfilter() {
		return userpowerfilter;
	}

	public void setUserpowerfilter(String userpowerfilter) {
		this.userpowerfilter = userpowerfilter;
	}

	public String getIconcls() {
		return iconcls;
	}

	public void setIconcls(String iconcls) {
		this.iconcls = iconcls;
	}

	public String getIsusedesktop() {
		return isusedesktop;
	}

	public void setIsusedesktop(String isusedesktop) {
		this.isusedesktop = isusedesktop;
	}

	public String getAddshutcut() {
		return addshutcut;
	}

	public void setAddshutcut(String addshutcut) {
		this.addshutcut = addshutcut;
	}

	public String getShutcuturl() {
		return shutcuturl;
	}

	public void setShutcuturl(String shutcuturl) {
		this.shutcuturl = shutcuturl;
	}
	

}
